fix: install prisma in runner stage to fix prisma generate#52
Open
davidorban wants to merge 1 commit intoviperrcrypto:mainfrom
Open
fix: install prisma in runner stage to fix prisma generate#52davidorban wants to merge 1 commit intoviperrcrypto:mainfrom
prisma generate#52davidorban wants to merge 1 commit intoviperrcrypto:mainfrom
Conversation
prisma and @prisma/client are listed as devDependencies, but the runner stage uses `npm ci --omit=dev` which skips them. The subsequent `RUN node_modules/.bin/prisma generate` then fails with: /bin/sh: node_modules/.bin/prisma: not found Fix: append `&& npm install --no-save prisma @prisma/client` so the binaries are available in the runner stage without adding them to production dependencies permanently. Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
prismaand@prisma/clientare listed asdevDependenciesinpackage.json. The runner stage of the Dockerfile usesnpm ci --omit=dev, which correctly skips dev dependencies — but then immediately tries to run:RUN node_modules/.bin/prisma generateThis fails with:
Anyone building the Docker image from source hits this error.
Fix
Append
&& npm install --no-save prisma @prisma/clientto the production install step so the Prisma CLI and client are available in the runner stage without being added to permanent production dependencies.RUN npm ci --omit=dev && npm install --no-save prisma @prisma/clientTesting
Built and ran the container locally —
prisma generatecompletes successfully and the app starts.